package com.itheima.mapper;

import com.github.pagehelper.Page;
import com.itheima.pojo.Student;
import com.itheima.pojo.StudentQueryParam;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

/**
 * @Author：cxl
 * @Package：com.itheima.mapper
 * @Project：web-project
 * @name：StudentMapper
 * @Date：2025-09-29 8:11 pm
 * @Filename：StudentMapper
 */
@Mapper
public interface StudentMapper {
    /*分页查询学生*/
    Page<Student> page(StudentQueryParam studentQueryParam);

    /*批量删除学生*/
    void deleteByIds(List<Integer> ids);

    /*添加学生*/
    void add(Student student);

    /*通过id查询学生*/
    Student selectById(Integer id);

    /*更新学生信息*/
    void update(Student student);

    /*学生违纪处理*/
    void violation(Integer id, Integer score);

    @MapKey("name")
        /*学生学历统计*/
    List<Map> countStudentDegreeData();


    /*班级统计*/
    @MapKey("name")
    List<Map<String, Object>> clazzData();
}
